<!doctype html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
<script>
    console.log('script start')

    async function async1() {
        await async2()
        // console.log('@@@', await async2(), async2())
        console.log('async1 end')   // 这一行变成微任务
    }

    async function async2() {
        console.log('async2 end')
        await (function () {
            console.log(23333)
        })()
        console.log('async3 end')   // 这一行变成微任务
    }

    async1()
    setTimeout(function () {
        console.log('setTimeout')
    }, 0)
    new Promise(resolve => {
        console.log('Promise')
        resolve()
    }).then(function () {
        console.log('promise1')
    }).then(function () {
        console.log('promise2')
    })
    console.log('script end')

    // script start
    // async2 end
    // Promise
    // script end
    // async1 end
    // promise1
    // promise2
    // setTimeout


</script>
</body>
</html>
